# -*- coding: utf-8 -*-
# @Author: Tim Liu
# @Date: 2025-01-20
# @Last Modified by: Tim Liu
# @Last Modified time: 2025-01-20
# @Description: Schema Hub for ISA95 compatible schemas

HAZARD_SUBSTANCE = """
{
    "node_types": {
        "Hazard_substance": {
            "properties": {
                "name": "STRING",
                "content": "STRING",
                "source_url": "STRING",
                "page": "STRING"
            },
            "indexes": {
                "hazard_substance_vidx" : {
                    "type": "VECTOR",
                    "vprop": "node_embedding"
                }
            }
        },
        "Health_hazard_information": {
            "properties": {
                "name": "STRING",
                "content": "STRING",
                "source_url": "STRING",
                "page": "STRING"
            }
        },
        "Workplace_controls_and_practices": {
            "properties": {
                "name": "STRING",
                "content": "STRING",
                "source_url": "STRING",
                "page": "STRING"
            }
        },
        "Personal_protective_equipment": {
            "properties": {
                "name": "STRING",
                "content": "STRING",
                "source_url": "STRING",
                "page": "STRING"
            },
            "indexes": {
                "protective_equipment_vidx" : {
                    "type": "VECTOR",
                    "vprop": "node_embedding"
                }
            }            
        }
    },
    "relationships": {
        "HASDETAIL_hazard_information": {
            "source": "Hazard_substance",
            "target": "Health_hazard_information",
            "properties": {}
        },
        "HASDETAIL_Practice": {
            "source": "Hazard_substance",
            "target": "Workplace_controls_and_practices",
            "properties": {}
        },
        "HASDETAIL_protective_equipment": {
            "source": "Hazard_substance",
            "target": "Personal_protective_equipment",
            "properties": {}
        }
    }

}
"""
    
CREWPLUS_ITR = """
{
    "node_types": {
        "Issue": {
            "properties": {
                "title": "STRING",                
                "author": "STRING",
                "date": "STRING",
                "department": "STRING",
                "revision": "STRING",
                "symptoms": "STRING",
                "immediate_action": "STRING",
                "corrective_actions": "STRING",
                "time_to_resolve": "STRING",
                "next_steps": "STRING",
                "name": "STRING",
		        "content": "STRING",                
                "source_url": "STRING",
                "page": "STRING"                
            },
            "indexes": {
                "issue_vidx" : {
                    "type": "VECTOR",
                    "vprop": "node_embedding"
                }
            }     
        },
        "Equipment": {
            "properties": {
                "equip_id": "STRING",
                "name": "STRING"
            }
        },
        "Symptom": {
            "properties": {
                "description": "STRING"
            }
        },
        "Root_cause": {
            "properties": {
                "description": "STRING",
                "source_url": "STRING",
                "page": "STRING"   
            }
        },
        "Counter_measure": {
            "properties": {
                "description": "STRING",
                "source_url": "STRING",
                "page": "STRING"   
            }
        },
        "Material": {
            "properties": {
                "material_id": "STRING",
                "material_name": "STRING"
            }
        },
        "Person": {
            "properties": {
                "person_id": "STRING",
                "name": "STRING",
                "role": "STRING"
            }
        },
        "Work_cell": {
            "properties": {
                "cell_id": "STRING",
                "name": "STRING"
            }
        },
        "Production_line": {
            "properties": {
                "line_id": "STRING",
                "name": "STRING"
            }
        },
        "Area": {
            "properties": {
                "area_id": "STRING",
                "name": "STRING"
            }
        },
        "Factory": {
            "properties": {
                "factory_id": "STRING",
                "name": "STRING"
            }
        }
    },
    "relationships": {
        "affected_equipment": {
            "source": "Issue",
            "target": "Equipment",
            "properties": {}
        },
        "has_symptom": {
            "source": "Issue",
            "target": "Symptom",
            "properties": {}
        },
        "has_rootcause": {
            "source": "Issue",
            "target": "Root_cause",
            "properties": {}
        },
        "has_counter_measure": {
            "source": "Root_cause",
            "target": "Counter_measure",
            "properties": {}
        },
        "associated_material": {
            "source": "Issue",
            "target": "Material",
            "properties": {}
        },
        "involved_personnel": {
            "source": "Issue",
            "target": "Person",
            "properties": {}
        },
        "part_of_work_cell": {
            "source": "Equipment",
            "target": "Work_cell",
            "properties": {}
        },
        "part_of_production_line": {
            "source": "Work_cell",
            "target": "Production_line",
            "properties": {}
        },
        "part_of_area": {
            "source": "Production_line",
            "target": "Area",
            "properties": {}
        },
        "part_of_factory": {
            "source": "Area",
            "target": "Factory",
            "properties": {}
        }
    }
}
"""